package com.mql.ganio.ui;

import com.mql.ganio.ui.fragment.AskFragment;
import com.mql.ganio.ui.fragment.FindFragment;
import com.mql.ganio.ui.fragment.GanIoFragment;

/**
 * @创建者 mql
 * @描述 主界面3个Fragment工厂
 */
public class FragmentFactory {

    static FragmentFactory mInstance;

    private FragmentFactory() {
    }

    public static FragmentFactory getInstance() {
        if (mInstance == null) {
            synchronized (FragmentFactory.class) {
                if (mInstance == null) {
                    mInstance = new FragmentFactory();
                }
            }
        }
        return mInstance;
    }

    private GanIoFragment mGanIoFragment;
    private AskFragment mAskFragment;
    private FindFragment mFindFragment;

    public GanIoFragment getGanIoFragment() {
        if (mGanIoFragment == null) {
            synchronized (FragmentFactory.class) {
                if (mGanIoFragment == null) {
                    mGanIoFragment = new GanIoFragment();
                }
            }
        }
        return mGanIoFragment;
    }

    public AskFragment getAskFragment() {
        if (mAskFragment == null) {
            synchronized (FragmentFactory.class) {
                if (mAskFragment == null) {
                    mAskFragment = new AskFragment();
                }
            }
        }
        return mAskFragment;
    }

    public FindFragment getFindFragment() {
        if (mFindFragment == null) {
            synchronized (FragmentFactory.class) {
                if (mFindFragment == null) {
                    mFindFragment = new FindFragment();
                }
            }
        }
        return mFindFragment;
    }


}
